package javapop.framework.generic;

import javapop.framework.generic.tool.GrammarVisitor;

public class GRegexp implements GParser {

	private String regexp;
	
	public GRegexp(String content) {
		regexp = content;
	}
	
	public String getRegexp() {
		return regexp;
	}
	
	@Override
	public <T,R,E extends Exception> T visit(GrammarVisitor<T,R, E> g) throws E {
		return g.visit(this);
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("@regexp(");
		sb.append(regexp);
		sb.append(");");
		return sb.toString();
	}
}
